


#ifndef PF_CREATION_H
#define PF_CREATION_H

#include "pf_entitycontainer.h"
#include "pf_line.h"
#include "pf_polyline.h"
#include "pf_insert.h"
#include "pf_image.h"
#include "pf_block.h"
#include "lx_Export.h"

/**
 * Data needed to insert library items.
 */
struct LX_EXPORT PF_LibraryInsertAttribute {
        QString file;
	PF_Vector insertionPoint;
	double factor;
	double angle;
};


/**
 * Class for the creation of new entities.
 * This class is bound to an entity container in which the
 * entities are stored. 
 *

 */
class LX_EXPORT PF_Creation {
public:
    PF_Creation(PF_Container* container,
                PF_GraphicView* graphicView=NULL,
                bool handleUndo=true);

    PF_Entity* createParallelThrough(const PF_Vector& coord,
                              int number,
                              PF_Entity* e);

    PF_Entity* createParallel(const PF_Vector& coord,
                              double distance,
                              int number,
                              PF_Entity* e);

    PF_Line* createParallelLine(const PF_Vector& coord,
                                double distance, int number,
                                PF_Line* e);

    PF_Arc* createParallelArc(const PF_Vector& coord,
                              double distance, int number,
                              PF_Arc* e);

    PF_Circle* createParallelCircle(const PF_Vector& coord,
                                    double distance, int number,
                                    PF_Circle* e);

    PF_Line* createBisector(const PF_Vector& coord1,
                            const PF_Vector& coord2,
                            double length,
                            int num,
                            PF_Line* l1,
                            PF_Line* l2);

    PF_Line* createTangent1(const PF_Vector& coord,
                            const PF_Vector& point,
                            PF_Entity* circle);

    PF_Line* createTangent2(const PF_Vector& coord,
                            PF_Entity* circle1,
                            PF_Entity* circle2);

    PF_Line* createLineRelAngle(const PF_Vector& coord,
                                PF_Entity* entity,
                                double angle,
                                double length);

    PF_Line* createPolygon(const PF_Vector& center,
                           const PF_Vector& corner,
                           int number);

    PF_Line* createPolygon2(const PF_Vector& corner1,
                            const PF_Vector& corner2,
                            int number);

    PF_Insert* createInsert(PF_InsertAttribute& data);
	
    PF_Image* createImage(PF_ImageAttribute& data);

    PF_Block* createBlock(const PF_BlockAttribute& data,
                          const PF_Vector& referencePoint,
                          const bool remove);
						  
    PF_Insert* createLibraryInsert(PF_LibraryInsertAttribute& data);

    //void createPoint(const PF_Vector& p);
    //void createLine2P(const PF_Vector& p1, const PF_Vector& p2);
    //void createRectangle(const PF_Vector& e1, const PF_Vector& e2);
    //PF_Polyline* createPolyline(const PF_Vector& p);

protected:
    PF_Container* container;
    PF_Graphic* graphic;
    PF_Document* document;
    PF_GraphicView* graphicView;
    bool handleUndo;
};

#endif
